package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * Created by LN on 2017/7/24.10:33
 */
@Entity
@Table(name = "coupon_present_detail")
public class CouponPresentDetailEntity extends BaseEntity {
    public enum CouponPresentDetailEntity_{
        toUser
    }
    private String presentNo;
    private Date ownDate;
    private String toUser;
    private String fromUser;
    private String remark;
    private String couponNo;
    private String newCouponNo;
    private String couponCode;
    private String isPresend;

    @Basic
    @Column(name = "present_no")
    public String getPresentNo() {
        return presentNo;
    }

    public void setPresentNo(String presentNo) {
        this.presentNo = presentNo;
    }

    @Basic
    @Column(name = "own_date")
    public Date getOwnDate() {
        return ownDate;
    }

    public void setOwnDate(Date ownDate) {
        this.ownDate = ownDate;
    }

    @Basic
    @Column(name = "to_user")
    public String getToUser() {
        return toUser;
    }

    public void setToUser(String toUser) {
        this.toUser = toUser;
    }

    @Basic
    @Column(name = "from_user")
    public String getFromUser() {
        return fromUser;
    }

    public void setFromUser(String fromUser) {
        this.fromUser = fromUser;
    }

    @Basic
    @Column(name = "remark")
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Basic
    @Column(name = "coupon_no")
    public String getCouponNo() {
        return couponNo;
    }

    public void setCouponNo(String couponNo) {
        this.couponNo = couponNo;
    }

    @Basic
    @Column(name = "new_coupon_no")
    public String getNewCouponNo() {
        return newCouponNo;
    }

    public void setNewCouponNo(String newCouponNo) {
        this.newCouponNo = newCouponNo;
    }

    @Basic
    @Column(name = "coupon_code")
    public String getCouponCode() {
        return couponCode;
    }

    public void setCouponCode(String couponCode) {
        this.couponCode = couponCode;
    }
    @Basic
    @Column(name = "is_presend")
    public String getIsPresend() {
        return isPresend;
    }

    public void setIsPresend(String isPresend) {
        this.isPresend = isPresend;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        CouponPresentDetailEntity that = (CouponPresentDetailEntity) o;

        if (presentNo != null ? !presentNo.equals(that.presentNo) : that.presentNo != null) return false;
        if (ownDate != null ? !ownDate.equals(that.ownDate) : that.ownDate != null) return false;
        if (toUser != null ? !toUser.equals(that.toUser) : that.toUser != null) return false;
        if (fromUser != null ? !fromUser.equals(that.fromUser) : that.fromUser != null) return false;
        if (remark != null ? !remark.equals(that.remark) : that.remark != null) return false;
        if (couponNo != null ? !couponNo.equals(that.couponNo) : that.couponNo != null) return false;
        if (newCouponNo != null ? !newCouponNo.equals(that.newCouponNo) : that.newCouponNo != null) return false;
        if (couponCode != null ? !couponCode.equals(that.couponCode) : that.couponCode != null) return false;
        return isPresend != null ? isPresend.equals(that.isPresend) : that.isPresend == null;
    }

    @Override
    public int hashCode() {
        int result = presentNo != null ? presentNo.hashCode() : 0;
        result = 31 * result + (ownDate != null ? ownDate.hashCode() : 0);
        result = 31 * result + (toUser != null ? toUser.hashCode() : 0);
        result = 31 * result + (fromUser != null ? fromUser.hashCode() : 0);
        result = 31 * result + (remark != null ? remark.hashCode() : 0);
        result = 31 * result + (couponNo != null ? couponNo.hashCode() : 0);
        result = 31 * result + (newCouponNo != null ? newCouponNo.hashCode() : 0);
        result = 31 * result + (couponCode != null ? couponCode.hashCode() : 0);
        result = 31 * result + (isPresend != null ? isPresend.hashCode() : 0);
        return result;
    }
}
